Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚠️ Clean up "deprecated" variables/functions in v1alpha4 #4078

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

Evalle
Copy link
Contributor

@Evalle Evalle commented Jan 14, 2021

What this PR does / why we need it:
Clean up "deprecated" variables/functions in v1alpha4

Which issue(s) this PR fixes
Fixes #4005

Dear reviewers
Please take a closer look at this, I could miss something.
Thank you!

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 14, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @Evalle. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 14, 2021
@fejta-bot
Copy link

Unknown CLA label state. Rechecking for CLA labels.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/check-cla

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 14, 2021
@fabriziopandini
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 15, 2021
@fabriziopandini
Copy link
Member

/milestone v0.4.0

@k8s-ci-robot k8s-ci-robot added this to the v0.4.0 milestone Jan 15, 2021
@fabriziopandini
Copy link
Member

fabriziopandini commented Jan 15, 2021

Oh, might be this overlaps in parts with #3929

@Evalle Evalle changed the title ✨ Clean up "deprecated" variables/functions in v1alpha4 ⚠️ Clean up "deprecated" variables/functions in v1alpha4 Jan 18, 2021
@Evalle
Copy link
Contributor Author

Evalle commented Jan 18, 2021

@fabriziopandini should I wait for #3929 to be merged and then rebase mine? Thanks!

@Evalle Evalle force-pushed the ISSUE-4005 branch 2 times, most recently from c934222 to 9da3750 Compare January 18, 2021 13:25
@fabriziopandini
Copy link
Member

fabriziopandini commented Jan 18, 2021

should I wait for #3929 to be merged and then rebase mine? Thanks!

I guess this can simplify this PR, so yes

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment, rest looks good

@Evalle
Copy link
Contributor Author

Evalle commented Jan 26, 2021

@vincepri thanks, fixed

@wfernandes
Copy link
Contributor

@Evalle Feel free to squash the commits. Also there are some linter and test build errors.

@Evalle
Copy link
Contributor Author

Evalle commented Feb 3, 2021

@wfernandes thanks for your comment, I'm waiting for #3929 to be merged first

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 10, 2021
@vincepri
Copy link
Member

@Evalle Do you have time to rebase?

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 4, 2021
@CecileRobertMichon
Copy link
Contributor

CecileRobertMichon commented Mar 4, 2021

@Evalle you need to run "make clean generate-bindata generate" and push the generated changes. I see changes when I run "make generate on this branch locally.

@CecileRobertMichon
Copy link
Contributor

I had a typo above, should be make clean generate-bindata generate

@Evalle
Copy link
Contributor Author

Evalle commented Mar 9, 2021

@CecileRobertMichon thank you, yes, I realized that. I run exactly make clean generate-bindata generate and added the files that were generated to the latest commit, it didn't help to pass the tests though. Maybe something is wrong with my local setup.

❯ make clean generate-bindata generate
/Applications/Xcode.app/Contents/Developer/usr/bin/make clean-bin
rm -rf bin
rm -rf hack/tools/bin
/Applications/Xcode.app/Contents/Developer/usr/bin/make clean-book
rm -rf ./docs/book/_book
hack/ensure-kustomize.sh
fetching kustomize@3.9.1
x kustomize
cd hack/tools; go build -tags=tools -o bin/go-bindata github.com/go-bindata/go-bindata/go-bindata
rm -rf cmd/clusterctl/config/manifest
/Users/user/Projects/cluster-api/hack/tools/bin/go-bindata -mode=420 -modtime=1 -pkg=cloudinit -o=bootstrap/kubeadm/internal/cloudinit/zz_generated.bindata.go.tmp bootstrap/kubeadm/internal/cloudinit/kubeadm-bootstrap-script.sh
cat ./hack/boilerplate/boilerplate.generatego.txt bootstrap/kubeadm/internal/cloudinit/zz_generated.bindata.go.tmp > bootstrap/kubeadm/internal/cloudinit/zz_generated.bindata.go
rm bootstrap/kubeadm/internal/cloudinit/zz_generated.bindata.go.tmp
# Package manifest YAML into a single file.
mkdir -p cmd/clusterctl/config/manifest/
/Users/user/Projects/cluster-api/hack/tools/bin/kustomize build cmd/clusterctl/config/crd > cmd/clusterctl/config/manifest/clusterctl-api.yaml
# Generate go-bindata, add boilerplate, then cleanup.
/Users/user/Projects/cluster-api/hack/tools/bin/go-bindata -mode=420 -modtime=1 -pkg=config -o=cmd/clusterctl/config/zz_generated.bindata.go cmd/clusterctl/config/manifest/ cmd/clusterctl/config/assets
cat ./hack/boilerplate/boilerplate.generatego.txt cmd/clusterctl/config/zz_generated.bindata.go > cmd/clusterctl/config/manifest/manifests.go
cp cmd/clusterctl/config/manifest/manifests.go cmd/clusterctl/config/zz_generated.bindata.go
# Cleanup the manifest folder.
/Applications/Xcode.app/Contents/Developer/usr/bin/make clean-bindata
rm -rf cmd/clusterctl/config/manifest
/Applications/Xcode.app/Contents/Developer/usr/bin/make generate-manifests
/Applications/Xcode.app/Contents/Developer/usr/bin/make generate-core-manifests
cd hack/tools; go build -tags=tools -o bin/controller-gen sigs.k8s.io/controller-tools/cmd/controller-gen
/Users/user/Projects/cluster-api/hack/tools/bin/controller-gen \
		paths=./api/... \
		paths=./controllers/... \
		paths=./exp/api/... \
		paths=./exp/controllers/... \
		paths=./exp/addons/api/... \
		paths=./exp/addons/controllers/... \
		crd:crdVersions=v1 \
		rbac:roleName=manager-role \
		output:crd:dir=./config/crd/bases \
		output:webhook:dir=./config/webhook \
		webhook
/Users/user/Projects/cluster-api/hack/tools/bin/controller-gen \
		paths=./cmd/clusterctl/api/... \
		crd:crdVersions=v1 \
		output:crd:dir=./cmd/clusterctl/config/crd/bases
/Applications/Xcode.app/Contents/Developer/usr/bin/make generate-kubeadm-bootstrap-manifests
/Users/user/Projects/cluster-api/hack/tools/bin/controller-gen \
		paths=./bootstrap/kubeadm/api/... \
		paths=./bootstrap/kubeadm/controllers/... \
		crd:crdVersions=v1 \
		rbac:roleName=manager-role \
		output:crd:dir=./bootstrap/kubeadm/config/crd/bases \
		output:rbac:dir=./bootstrap/kubeadm/config/rbac \
		output:webhook:dir=./bootstrap/kubeadm/config/webhook \
		webhook
/Applications/Xcode.app/Contents/Developer/usr/bin/make generate-kubeadm-control-plane-manifests
/Users/user/Projects/cluster-api/hack/tools/bin/controller-gen \
		paths=./controlplane/kubeadm/api/... \
		paths=./controlplane/kubeadm/controllers/... \
		crd:crdVersions=v1 \
		rbac:roleName=manager-role \
		output:crd:dir=./controlplane/kubeadm/config/crd/bases \
		output:rbac:dir=./controlplane/kubeadm/config/rbac \
		output:webhook:dir=./controlplane/kubeadm/config/webhook \
		webhook
/Applications/Xcode.app/Contents/Developer/usr/bin/make generate-go
go generate ./...
/Applications/Xcode.app/Contents/Developer/usr/bin/make generate-go-core
cd hack/tools; go build -tags=tools -o bin/conversion-gen k8s.io/code-generator/cmd/conversion-gen
/Users/user/Projects/cluster-api/hack/tools/bin/controller-gen \
		object:headerFile=./hack/boilerplate/boilerplate.generatego.txt \
		paths=./api/... \
		paths=./exp/api/... \
		paths=./exp/addons/api/... \
		paths=./cmd/clusterctl/...
/Applications/Xcode.app/Contents/Developer/usr/bin/make clean-generated-conversions SRC_DIRS="./api/v1alpha3,./exp/api/v1alpha3,./exp/addons/api/v1alpha3"
(IFS=','; for i in ./api/v1alpha3,./exp/api/v1alpha3,./exp/addons/api/v1alpha3; do find $i -type f -name 'zz_generated.conversion*' -exec rm -f {} \;; done)
/Users/user/Projects/cluster-api/hack/tools/bin/conversion-gen \
		--input-dirs=./api/v1alpha3 \
		--build-tag=ignore_autogenerated_core_v1alpha3 \
		--output-file-base=zz_generated.conversion \
		--go-header-file=./hack/boilerplate/boilerplate.generatego.txt
2021/03/09 09:51:11 gopathwalk: scanning directory /Users/user/go/pkg/mod: readdirent: interrupted system call
/Users/user/Projects/cluster-api/hack/tools/bin/conversion-gen \
		--input-dirs=./exp/api/v1alpha3 \
		--input-dirs=./exp/addons/api/v1alpha3 \
		--extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha3 \
		--output-file-base=zz_generated.conversion \
		--go-header-file=./hack/boilerplate/boilerplate.generatego.txt
2021/03/09 09:54:53 gopathwalk: scanning directory /Users/user/go/pkg/mod/go.opencensus.io@v0.22.3: readdirent: interrupted system call
2021/03/09 09:55:15 gopathwalk: scanning directory /Users/user/go/pkg/mod: open /Users/user/go/pkg/mod/k8s.io/client-go@v0.19.2/deprecated/typed/apps/v1beta1: interrupted system call
2021/03/09 09:55:32 gopathwalk: scanning directory /Users/user/go/pkg/mod: readdirent: interrupted system call
/Applications/Xcode.app/Contents/Developer/usr/bin/make generate-go-kubeadm-bootstrap
/Users/user/Projects/cluster-api/hack/tools/bin/controller-gen \
		object:headerFile=./hack/boilerplate/boilerplate.generatego.txt \
		paths=./bootstrap/kubeadm/api/... \
		paths=./bootstrap/kubeadm/types/...
/Applications/Xcode.app/Contents/Developer/usr/bin/make clean-generated-conversions SRC_DIRS="./bootstrap/kubeadm/api"
(IFS=','; for i in ./bootstrap/kubeadm/api; do find $i -type f -name 'zz_generated.conversion*' -exec rm -f {} \;; done)
/Users/user/Projects/cluster-api/hack/tools/bin/conversion-gen \
		--input-dirs=./bootstrap/kubeadm/api/v1alpha3 \
		--build-tag=ignore_autogenerated_kubeadm_bootstrap_v1alpha3 \
		--extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha3 \
		--output-file-base=zz_generated.conversion \
		--go-header-file=./hack/boilerplate/boilerplate.generatego.txt
/Applications/Xcode.app/Contents/Developer/usr/bin/make generate-go-kubeadm-control-plane
/Users/user/Projects/cluster-api/hack/tools/bin/controller-gen \
		object:headerFile=./hack/boilerplate/boilerplate.generatego.txt \
		paths=./controlplane/kubeadm/api/...
/Applications/Xcode.app/Contents/Developer/usr/bin/make clean-generated-conversions SRC_DIRS="./controlplane/kubeadm/api"
(IFS=','; for i in ./controlplane/kubeadm/api; do find $i -type f -name 'zz_generated.conversion*' -exec rm -f {} \;; done)
/Users/user/Projects/cluster-api/hack/tools/bin/conversion-gen \
		--input-dirs=./controlplane/kubeadm/api/v1alpha3 \
		--build-tag=ignore_autogenerated_kubeadm_controlplane_v1alpha3 \
		--extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha3,sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha3 \
		--output-file-base=zz_generated.conversion \
		--go-header-file=./hack/boilerplate/boilerplate.generatego.txt
2021/03/09 10:03:47 gopathwalk: scanning directory /Users/user/go/pkg/mod/github.com/gogo/protobuf@v1.3.2: readdirent: interrupted system call
2021/03/09 10:03:50 gopathwalk: scanning directory /Users/user/go/pkg/mod: open /Users/user/go/pkg/mod/golang.org/x/tools@v0.0.0-20200724172932-b5fc9d354d99/cmd/callgraph: interrupted system call
/Applications/Xcode.app/Contents/Developer/usr/bin/make generate-bindata
rm -rf cmd/clusterctl/config/manifest
# Package manifest YAML into a single file.
mkdir -p cmd/clusterctl/config/manifest/
/Users/user/Projects/cluster-api/hack/tools/bin/kustomize build cmd/clusterctl/config/crd > cmd/clusterctl/config/manifest/clusterctl-api.yaml
# Generate go-bindata, add boilerplate, then cleanup.
/Users/user/Projects/cluster-api/hack/tools/bin/go-bindata -mode=420 -modtime=1 -pkg=config -o=cmd/clusterctl/config/zz_generated.bindata.go cmd/clusterctl/config/manifest/ cmd/clusterctl/config/assets
cat ./hack/boilerplate/boilerplate.generatego.txt cmd/clusterctl/config/zz_generated.bindata.go > cmd/clusterctl/config/manifest/manifests.go
cp cmd/clusterctl/config/manifest/manifests.go cmd/clusterctl/config/zz_generated.bindata.go
# Cleanup the manifest folder.
/Applications/Xcode.app/Contents/Developer/usr/bin/make clean-bindata
rm -rf cmd/clusterctl/config/manifest
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C test/infrastructure/docker generate
/Applications/Xcode.app/Contents/Developer/usr/bin/make generate-manifests
hack/tools/bin/controller-gen \
		paths=./api/... \
		paths=./exp/api/... \
		paths=./exp/controllers/... \
		paths=./controllers/... \
		crd:crdVersions=v1 \
		rbac:roleName=manager-role \
		output:crd:dir=./config/crd/bases \
		output:webhook:dir=./config/webhook \
		webhook
/Applications/Xcode.app/Contents/Developer/usr/bin/make generate-go
hack/tools/bin/controller-gen \
		object:headerFile=../../../hack/boilerplate/boilerplate.generatego.txt \
		paths=./api/... \
		paths=./exp/api/...
(IFS=','; for i in "./api/v1alpha3,./exp/api/v1alpha3"; do find $i -type f -name 'zz_generated.conversion*' -exec rm -f {} \;; done)
hack/tools/bin/conversion-gen \
		--input-dirs=./api/v1alpha3 \
		--input-dirs=./exp/api/v1alpha3 \
		--build-tag=ignore_autogenerated_capd_v1alpha3 \
		--extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha3 \
		--output-file-base=zz_generated.conversion \
		--go-header-file=../../../hack/boilerplate/boilerplate.generatego.txt
2021/03/09 10:07:39 gopathwalk: scanning directory /Users/user/go/pkg/mod: readdirent: interrupted system call

The last gopathwalk message is bothering me.

❯ go version
go version go1.15.7 darwin/amd64

@CecileRobertMichon
Copy link
Contributor

go version go1.15.7 darwin/amd64

you need to update to go 1.16

@Evalle
Copy link
Contributor Author

Evalle commented Mar 10, 2021

Thanks, @CecileRobertMichon

With go 1.16

$ go version 
go1.16 darwin/amd64

$ make clean generate-bindata generate
...
goroutine 1 [running]:
k8s.io/gengo/parser.(*Builder).AddDirTo(0xc00006b630, 0xc0000d8b54, 0x3f, 0xc0004d0008, 0x0, 0x0)
	/Users/user/go/pkg/mod/k8s.io/gengo@v0.0.0-20201214224949-b6c5ce23f027/parser/parse.go:272 +0xa5
k8s.io/gengo/generator.(*Context).AddDir(...)
	/Users/user/go/pkg/mod/k8s.io/gengo@v0.0.0-20201214224949-b6c5ce23f027/generator/generator.go:246
k8s.io/code-generator/cmd/conversion-gen/generators.Packages(0xc0004d0000, 0xc00010cf00, 0x13733f7, 0x6, 0xc0004d0000)
	/Users/user/go/pkg/mod/k8s.io/code-generator@v0.21.0-beta.0/cmd/conversion-gen/generators/conversion.go:307 +0x1199
k8s.io/gengo/args.(*GeneratorArgs).Execute(0xc00010cf00, 0xc000075080, 0x13733f7, 0x6, 0x13a1650, 0xc000116b40, 0x2)
	/Users/user/go/pkg/mod/k8s.io/gengo@v0.0.0-20201214224949-b6c5ce23f027/args/args.go:206 +0x1a9
main.main()
	/Users/user/go/pkg/mod/k8s.io/code-generator@v0.21.0-beta.0/cmd/conversion-gen/main.go:129 +0x365
make[2]: *** [generate-go] Error 2
make[1]: *** [generate] Error 2
make: *** [generate] Error 2

^ this with the latest changes from the upstream, may I ask you to push the files generated on your machine to my branch?

@Evalle Evalle force-pushed the ISSUE-4005 branch 2 times, most recently from 2fb0558 to a336001 Compare March 10, 2021 17:57
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 10, 2021
@detiber
Copy link
Member

detiber commented Mar 10, 2021

Love to see this type of cleanup.
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 10, 2021
@CecileRobertMichon
Copy link
Contributor

@Evalle looks like you figured it out? PR looks good now, thanks for taking care of this!

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 10, 2021
@CecileRobertMichon
Copy link
Contributor

squashed the commits

@CecileRobertMichon
Copy link
Contributor

/lgmt
/assign @detiber

@k8s-ci-robot
Copy link
Contributor

@Evalle: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-cluster-api-apidiff-main e9e3503 link /test pull-cluster-api-apidiff-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@fabriziopandini
Copy link
Member

fabriziopandini commented Mar 12, 2021

/lgtm
Kudos to @Evalle for the work on this PR!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 12, 2021
@CecileRobertMichon
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 12, 2021
@k8s-ci-robot k8s-ci-robot merged commit c9e9b27 into kubernetes-sigs:master Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up "deprecated" variables/functions in v1alpha4
8 participants